MS-DOS:1.25:CDS OEM:1.07/DATABASE.BAS
A general data base system program. Strings 0x6-0x24 Program name. --- A general data base system 0x2B-0x6F --- Modified for Corona Data Systems, Inc. 08/23/83 by Elwood Clarke 0x76-0xB0 --- Modified for and by Corona Data Systems, Inc. 12/01/83 0xB7-0xF9 Note: 1. Functions start on even hundered line numbers for ease of 0x100-0x11E program modification. 0x125-0x159 2. Records are stored in a random access file. 0x160-0x1A2 3. Record interiors are sequentially packed for compactness. 0x1B1-0x1E0 Set up of variable matricies for maximum size 0x1FE-0x216 Length - Question & Data 0x21F-0x241 "...............................: " 0x24A-0x24F " " 0x260-0x278 Error handling routines 0x284-0x2B8 Program name and version. "DATABASE: A general data base system - Version 2.01" 0x2C0-0x2F0 Copyright. "Copyright © 1983,84 Corona Data Systems, Inc." 0x2FB-0x32A "This version requires a minimum of 256K memory" 0x336-0x360 "Does your system meet these requirements?" 0x3A4-0x3A6 "y" 0x3B3-0x3B5 "Y" 0x3C0-0x3D7 Program title screen. 0x3E8-0x3FE Company name. "Corona Data Systems" 0x40D-0x41F Program name. "Database Program" 0x42E-0x455 "Here are examples of legal file names:" 0x464-0x48E "A:EXAMPLE.DAT EXAMPLE.DAT EXAMPLE" 0x49D-0x4C9 "Enter the file name of the datafile (Press " 0x4E0-0x4EC " to exit): " 0x502-0x503 "" 0x510-0x531 --- Quit if there is no file name 0x540-0x56A --- Check to see if the file name is valid 0x571-0x57F FILE.NAME.ERR 0x596-0x5AA " ILLEGAL FILENAME " 0x604-0x617 " FILE NOT FOUND " 0x62D-0x648 "Is this to be a new file? " 0x68E-0x6BF This is a new file and the number or records is 0 0x6C6-0x6F6 --- This is the menu section from line 100 - 199 0x704-0x715 Clear the screen 0x726-0x73C Company name. "Corona Data Systems" 0x74B-0x75D Program name. "Database Program" 0x76C-0x777 "MAIN MENU" 0x78B-0x7AF "I)nit......Initializes the datafile" 0x7BD-0x7EC "E)ntr......Enters or Adds data to the datafile" 0x7FB-0x82B "L)ook......Finds and Displays a specific record" 0x83A-0x869 "C)hng......Allows changes to a specific record" 0x878-0x8A2 "S)rch......Searches for a specific record" 0x8B1-0x8D6 "D)el.......Deletes a specific record" 0x8E5-0x90C "Q)uit......Leaves the current datafile" 0x91D-0x93D "Which function would you like? " 0x953-0x979 Take the first character of the answer 0x985-0x987 "q" 0x990-0x992 "Q" 0x9B2-0x9B4 "I" 0x9BE-0x9C0 "i" 0x9DD-0xA02 " New files must first be initalized " 0xA20-0xA22 "I" 0xA29-0xA2B "E" 0xA34-0xA36 "L" 0xA3F-0xA41 "C" 0xA4A-0xA4C "S" 0xA55-0xA57 "D" 0xA60-0xA62 "Q" 0xA68-0xA82 Depending on 1 through 6 0xA90-0xA92 "i" 0xA99-0xA9B "e" 0xAA4-0xAA6 "l" 0xAAF-0xAB1 "c" 0xABA-0xABC "s" 0xAC5-0xAC7 "d" 0xAD0-0xAD2 "q" 0xAD8-0xAF7 accept also lower case letters 0xB42-0xB5E " " 0xB74-0xB86 " Invalid Choice " 0xB9A-0xBCA ---- This is the file initialization program --- 0xBD8-0xC02 REM Open the file used for data storage 0xC2D-0xC2F "y" 0xC3F-0xC41 "Y" 0xC81-0xC87 page 1 0xC99-0xC9B "n" 0xCAA-0xCAC "N" 0xD55-0xD5B page 2 0xD6D-0xD6F "n" 0xD7E-0xD80 "N" 0xE3B-0xE5A Pack the data and then return 0xE6C-0xE94 Save record 1 which contains questions 0xEA2-0xEB3 Close the file 0xEC1-0xED6 Return to the menu 0xEDD-0xF02 This is the data entry program---- 0xF10-0xF36 Open the file used for data storage 0xF50-0xF78 ---Get the file information and unpack it 0xF9F-0xFAB page 1 entry 0xFC3-0xFC5 "n" 0xFD4-0xFD6 "N" 0x102D-0x102F " " 0x103A-0x104C end of page 1 edit 0x105F-0x106D no second page 0x108E-0x109A page 2 entry 0x10B2-0x10B4 "n" 0x10C3-0x10C5 "N" 0x111D-0x111F " " 0x112A-0x113C end of page 2 edit 0x1143-0x1151 done inputting 0x1167-0x1177 " Adding Record " 0x1197-0x11AC ---Resave file header 0x11C8-0x11F3 ---Pack and save data on file in record n+1 0x1211-0x1228 reprint the bottom line 0x1236-0x1247 ---Close the file 0x127E-0x12A4 "Do you wish to enter another record? " 0x12B9-0x12BB "y" 0x12CA-0x12CC "Y" 0x12D8-0x12FB ---Return to the data entry portion 0x1309-0x1323 ---Return to the main menu 0x132A-0x1353 ---This is the data inspection program--- 0x1361-0x138A ---Open the file used for data storage--- 0x13A3-0x13CB ---Get file information and unpack it--- 0x1443-0x1467 ---Get the desired record to look at 0x1475-0x148C ---Unpack the record--- 0x14B9-0x14BF page 1 0x14FC-0x1502 page 2 0x1579-0x157B "1" 0x1584-0x1586 "2" 0x1598-0x159A "-" 0x15A4-0x15A6 "+" 0x15AD-0x15AF "=" 0x15E2-0x15F6 ---Close the file--- 0x1603-0x161B ---Return to the menu--- 0x1622-0x1647 ---This is the data change program--- 0x1655-0x167E ---Open the file used for data storage--- 0x1697-0x16BF ---Get file information and unpack it--- 0x173C-0x175F ---Get and unpack desired record--- 0x1780-0x178A page 1 mod 0x17A4-0x17A6 "0" 0x17AF-0x17B1 "-" 0x17BB-0x17BD "+" 0x17C4-0x17C6 "=" 0x1808-0x180A " " 0x1826-0x1828 " " 0x18B9-0x18C3 page 2 mod 0x18DD-0x18DF "0" 0x18E8-0x18EA "-" 0x18F4-0x18F6 "+" 0x18FD-0x18FF "=" 0x1941-0x1943 " " 0x195F-0x1961 " " 0x19DD-0x1A04 ---Pack and save data back onto disk--- 0x1A11-0x1A25 ---Close the file--- 0x1A32-0xA4B --- Return to the menu--- 0x1A52-0x1A77 ---This is the data search program--- 0x1A84-0x1AAD ---Open the file used for data storage--- 0x1AC5-0x1AD6 ---Get and Unpack 0x1AFD-0x1B03 page 1 0x1B39-0x1B3B " " 0x1B74-0x1B7A page 2 0x1BB0-0x1BB2 " " 0x1BE7-0x1BFD search option screen 3 0x1D3F-0x1D46 "######" 0x1D94-0x1D96 "Y" 0x1D9F-0x1DA1 "y" 0x1DBB-0x1DCB ---Close file--- 0x1DD8-0x1DF0 ---Return to the menu--- 0x1DF7-0x1E1C ---This is the data delete program--- 0x1E2A-0x1E53 ---Open the file used for data storage--- 0x1E6B-0x1E93 ---Get file information and unpack it--- 0x1EC5-0x1ECC ---Done 0x1F17-0x1F20 DEL.FLAG 0x1F41-0x1F54 " Deleting Record " 0x1F70-0x1F88 ---Delete last record--- 0x1FBD-0x1FDE ---Shift all following records--- 0x1FFD-0x2022 --Reset the header back one pointer-- 0x203A-0x204E --close the file --- 0x205C-0x2074 ---Return to the menu--- 0x20A1-0x20BF ---Open file-all results=B$--- 0x20CC-0x20E1 ---Close that file--- 0x20E8-0x20FC ---PUT SUBROUTINE--- 0x2168-0x216B " " 0x217E-0x2192 ---GET SUBROUTINE--- 0x21C6-0x21E1 - Error return subroutine - 0x220F-0x2231 Status message update subroutines 0x2246-0x2252 " Datafile: " 0x2257-0x2259 " " 0x226C-0x2272 "#### " 0x2279-0x228E "Records in Database " 0x22AA-0x22C1 "Initialization Option" 0x22D2-0x2305 "You have picked the Initialization option. This" 0x2314-0x2347 "option will allow the database program to write to" 0x2356-0x2367 "a new data file." 0x2383-0x23BE " HOWEVER THIS OPTION WILL DELETE ALL EXISTING DATA " 0x23DA-0x23FA "Do you wish to continue (Y/N)? " 0x240F-0x241A "Data file " 0x241F-0x2438 " will now be initialized" 0x2448-0x2479 "How many questions for the data base are there? " 0x24BE-0x24EB " No more than 30 or less than 2 are allowed " 0x2505-0x2538 "Enter the question for each field # when prompted." 0x2546-0x258A "Field # Question (max length = 25 chars.) Remaining space = " 0x2591-0x2959 "###" 0x25EA-0x25ED "##" 0x2612-0x2615 "##" 0x263A-0x263C " " 0x265F-0x2663 "###" 0x266A-0x2677 " Chars. left" 0x269B-0x269D " " 0x26C0-0x26C4 "###" 0x26CB-0x26D8 " Chars. left" 0x26ED-0x271A "DO YOU WANT TO CHANGE ANY OF THE QUESTIONS? " 0x273C-0x273E " " 0x2768-0x276A " " 0x2784-0x27C0 "Enter the Field # of the question you would like to change." 0x27D0-0x27D6 "(0 - " 0x27E1-0x2802 " Exits to second screen or menu " 0x280D-0x2810 " )" 0x2820-0x282A "Field #? " 0x2841-0x2843 " " 0x285E-0x2860 " " 0x2877-0x288B "Data Entry Option" 0x289E-0x28C0 "Do you wish to make corrections? " 0x2981-0x2983 " " 0x29AE-0x29B0 " " 0x29D8-0x29DB "##" 0x2A01-0x2A04 "##" 0x2A1B-0x2A53 "Enter the Field # of the data you would like to change." 0x2A63-0x2A69 "(0 - " 0x2A74-0x2A9C " Exit to second screen or exit to menu " 0x2AA7-0x2AAA " )" 0x2AB6-0x2AC0 "Field #? " 0x2AD7-0x2AD9 " " 0x2AF5-0x2AF7 " " 0x2B0E-0x2B29 "Find and Display Option" 0x2B47-0x2B61 " Invalid Record Number " 0x2B7E-0x2B92 "( 0 - EXIT OPTION )" 0x2B9C-0x2BBA "Enter desired record number? " 0x2BCD-0x2BE5 "Display Record Option" 0x2BF6-0x2C10 "Hit Return to Continue..." 0x2C1F-0x2C3C "or <+> to advance one record" 0x2C4B-0x2C67 "or <-> to backup one record" 0x2C76-0x2C8C "or <1> for first page" 0x2C9B-0x2CBD "or <2> for second page if present" 0x2CDA-0x2CDC " " 0x2D05-0x2D07 " " 0x2D22-0x2D37 "Modification Option" 0x2D47-0x2D7F "Enter the Field # of the data you would like to change." 0x2D8D-0x2DB2 "Field # Question Data" 0x2DC2-0x2DF1 "( <+> or <-> to advance or backup one record )" 0x2E02-0x2E08 "(0 - " 0x2E13-0x2E3B " Exit to second screen or exit to menu " 0x2E46-0x2E49 " )" 0x2E55-0x2E5F "Field #? " 0x2E80-0x2E83 "##" 0x2EDD-0x2EE0 "##" 0x2F2D-0x2F3C "Search Option" 0x2F5A-0x2F5D "##" 0x2FBF-0x2FD6 "Field # Question" 0x2FE4-0x300D "Enter the field # of field to search on." 0x301C-0x3023 "( 0 - " 0x302E-0x305F " To exit to second screen or exit Search option " 0x306A-0x306D " )" 0x307E-0x3088 "Field #? " 0x30A2-0x30B5 " Data not found " 0x30CB-0x30E8 "Enter the data to search on." 0x30F6-0x3100 "Question:" 0x311E-0x3139 "Data located in record #: " 0x3145-0x314C "Data? " 0x3162-0x3173 "Again (Y or N)? " 0x3187-0x3196 "Delete Option" 0x319F-0x31C6 ---PACKING AND UNPACKING SUBROUTINES--- 0x31CD-0x31DA Pack 0 a$ is 0x3215-0x323C ---First enter the number of records--- 0x3250-327F Then the number of fields and lengths of fields 0x32BD-0x32E1 Then store the question in record 0 0x3306-0x3315 Unpack record 0 0x3341-0x335D number of fields and records 0x3370-0x3386 Starting byte position 0x339A-0x33AB Unpacking strings 0x33F2-0x340D Pointer for the next string 0x3422-0x3445 Pack n - packs records for record n 0x3463-0x3470 pack record n 0x34D0-0x34EB Unpack n - unpacks record n 0x3561-0x35A1 ---Subroutine to make sure you have the correct record to delete 0x35DC-0x35E4 "Record " 0x362B-0x3652 "Is this the correct record to delete? " 0x3668-0x366A "Y" 0x3677-0x3679 "y" 0x367D-0x3685 DEL.FLAG 0x368C-0x3695 DEL.FLAG 0x36A5-0x36CC --- Check to see if the file name is ok 0x36D2-0x36DE FILE.NAME.ERR 0x36FE-0x370B FILE.NAME.ERR 0x3756-0x3763 FILE.NAME.ERR 0x3784-0x3791 FILE.NAME.ERR 0x37E2-0x37F0 FILE.NAME.ERR 0x37FA-0x3808 FILE.NAME.ERR 0x3813-0x3839 --- Problem with periods and/or colons 0x3866-0x3867 "" 0x392A-0x3937 FILE.NAME.ERR 0x3966-0x3973 FILE.NAME.ERR 0x39AA-0x39B7 FILE.NAME.ERR 0x39E6-0x39F3 FILE.NAME.ERR Program in Action